import request from '@/utils/request'

// 查询报修申请列表
export function listClaim(query) {
  return request({
    url: '/dailyoperations/claim/list',
    method: 'get',
    params: query
  })
}

// 查询报修申请详细
export function getClaim(id) {
  return request({
    url: '/dailyoperations/claim/' + id,
    method: 'get'
  })
}

// 新增报修申请
export function addClaim(data) {
  return request({
    url: '/dailyoperations/claim',
    method: 'post',
    data: data
  })
}

// 修改报修申请
export function updateClaim(data) {
  return request({
    url: '/dailyoperations/claim',
    method: 'put',
    data: data
  })
}
// 接单报修
export function receiveClaim(data) {
  return request({
    url: '/dailyoperations/claim/receive',
    method: 'put',
    data: data
  })
}
// 拒单报修(第一步修改状态）
export function rejectClaim(data) {
  return request({
    url: '/dailyoperations/claim/reject',
    method: 'put',
    data: data
  })
}

// (第二步添加到结果表单）
export function rejectClaim2(data) {
  return request({
    url: '/dailyoperations/result',
    method: 'post',
    data: data
  })
}

// 删除报修申请
export function delClaim(id) {
  return request({
    url: '/dailyoperations/claim/' + id,
    method: 'delete'
  })
}
